package com.omt.tarjimdinek.domain.member.service;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.apache.log4j.Logger;

import com.omt.tarjimdinek.domain.member.dao.AdresseDao;
import com.omt.tarjimdinek.domain.member.entity.Adresse;
import com.omt.tarjimdinek.support.GenericDao;
import com.omt.tarjimdinek.support.RepositoryImpl;

/**
 * Adresse manager implements
 * @author chabane
 *
 */
@Named("adresseRepository")
@Singleton
public class AdresseRepositoryImpl extends RepositoryImpl<Adresse, Long> implements AdresseRepository {

	private AdresseDao adresseDao; 
	
	@SuppressWarnings("unused")
	private static final Logger log = Logger.getLogger(AdresseRepositoryImpl.class);

	@Inject
	public void setAdresseDao(AdresseDao adresseDao) {
	   this.adresseDao = adresseDao;
	}

	/**
	  * Dao getter used by the {@link RepositoryImpl}.
	  */
	@Override
	public GenericDao<Adresse, Long> getDao() {
	   return adresseDao;
	}     

	/**
     * {@inheritDoc}
     */
    @Override
    public Adresse getNew() {
        return new Adresse();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Adresse getNewWithDefaults() {
    	Adresse result = getNew();
        result.initDefaultValues();
        return result;
    }

    /**
     * {@inheritDoc}
     */
	@Override
	public void create(Adresse aAdresse) {
		save(aAdresse);
	}
}
